package com.cmc.cloud.cmclink.doc.convert;

import com.cmc.cloud.cmclink.doc.api.document.rep.BlnoLocalChargeBaseDto;
import com.cmc.cloud.cmclink.doc.entity.BlnoDO;
import com.cmc.cloud.cmclink.doc.entity.BlnoLocalChargeDO;
import com.cmc.cloud.cmclink.doc.vo.blnochargevo.BlnoLocalChargeCreateReqVO;
import com.cmc.cloud.cmclink.doc.vo.blnochargevo.BlnoLocalChargeRespVO;
import com.cmc.cloud.cmclink.doc.vo.blnochargevo.BlnoLocalChargeUpdateReqVO;
import com.cmc.cloud.cmclink.doc.vo.blnolocalchargevo.BlnoLocalChargeAddReqVO;
import com.cmc.cloud.cmclink.doc.vo.blnolocalchargevo.BlnoLocalChargeDetailRespVO;
import com.cmc.cloud.cmclink.doc.vo.blnolocalchargevo.BlnoLocalChargeTempVO;
import com.cmc.cloud.cmclink.fin.api.base.dto.req.DocBlnoCreateReqDTO;
import com.cmc.cloud.cmclink.fin.api.base.dto.req.DocBlnoFreightInfoReqDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Local Charge费用 Convert
 *
 * @author 集运管理员
 */
@Mapper
public interface BlnoLocalChargeConvert {
    /**
     * 获取转换接口的实例
     */
    BlnoLocalChargeConvert INSTANCE = Mappers.getMapper(BlnoLocalChargeConvert.class);

    /**
     * 将创建请求VO转换为DO
     *
     * @param bean 创建请求VO
     * @return DO
     */
    BlnoLocalChargeDO convert(BlnoLocalChargeCreateReqVO bean);

    /**
     * 将更新请求VO转换为DO
     *
     * @param bean 更新请求VO
     * @return DO
     */
    BlnoLocalChargeDO convert(BlnoLocalChargeUpdateReqVO bean);

    /**
     * 将DO转换为查询响应VO
     *
     * @param bean DO
     * @return VO
     */
    BlnoLocalChargeRespVO convert(BlnoLocalChargeDO bean);

    /**
     * 将DO列表转换为查询响应VO列表
     *
     * @param list DO列表
     * @return VO List
     */
    List<BlnoLocalChargeRespVO> convertList(List<BlnoLocalChargeDO> list);

    /**
     * 属性转换
     *
     * @param blnoLocalChargeDoList
     * @return
     */
    List<BlnoLocalChargeBaseDto> convertBlnoLocalChargeBaseDto(List<BlnoLocalChargeDO> blnoLocalChargeDoList);

    /**
     * 属性转换
     *
     * @param blnoLocalChargeTempVo
     * @return
     */
    BlnoLocalChargeDO convertblnoLocalChargeDo(BlnoLocalChargeTempVO blnoLocalChargeTempVo);

    /**
     * 属性转换
     *
     * @param blnoLocalChargeAddReqVo
     * @return
     */
    BlnoLocalChargeDO convertLocalChargeDo(BlnoLocalChargeAddReqVO blnoLocalChargeAddReqVo);

    /**
     * 属性转换
     *
     * @param blnoDO
     * @return
     */
    @Mappings(value = {@Mapping(target = "blnoId", source = "id"), @Mapping(target = "blno", source = "blNo"),
            @Mapping(target = "porCode", source = "porCode"), @Mapping(target = "delCode", source = "delCode"),
            @Mapping(target = "scno", source = "agreementNo"), @Mapping(target = "spaceOwner", source = "spaceOwner"),
            @Mapping(target = "documentType", constant = "SI")})
    DocBlnoCreateReqDTO convertDocBlnoCreateReqDTO(BlnoDO blnoDO);

    /**
     * 属性转换
     * @param blnoLocalChargeDoList 入参
     * @return List<BlnoLocalChargeDetailRespVO>
     */
    List<BlnoLocalChargeDetailRespVO> convertBlnoLocalChargeDetailRespVo(List<BlnoLocalChargeDO> blnoLocalChargeDoList);

}
